package com.situ.hospital.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.situ.hospital.dao.IMedicineDAO;
import com.situ.hospital.dao.Impl.MedicineDAOImpl;
import com.situ.hospital.pojo.Medicine;

public class MedicineExcelListener extends AnalysisEventListener<Medicine> {

    private IMedicineDAO medicineDAO = new MedicineDAOImpl();

    @Override
    public void invoke(Medicine medicine, AnalysisContext analysisContext) {
        System.out.println("MedicineExcelListener.invoke");
        System.out.println(medicine);
        medicineDAO.addExcel(medicine);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("MedicineExcelListener.doAfterAllAnalysed");
    }
}
